import { ref } from 'vue'
import { defineStore } from 'pinia'

export const usePatientStore = defineStore('patient', () => {
  const patientId = ref('')
  const patientName = ref('')
  const updatePatientId = (value) => {
    patientId.value = value
  }
  const updatePatientName = (value) => {
    patientName.value = value
  }
  return { patientId, patientName, updatePatientId, updatePatientName }
})

export const useMemberStore = defineStore('member', () => {
  const show = ref(false)
  const phy_name = ref('')
  const phy_time = ref('')
  const updateShow = (value) => {
    show.value = value
  }
  const updatePhyName = (value) => {
    phy_name.value = value
  }
  const updatePhyTime = (value) => {
    phy_time.value = value
  }
  return { show, updateShow, phy_name, phy_time, updatePhyName, updatePhyTime }
})

export const usePopupStore = defineStore('popup', () => {
  const show = ref(false)
  const updateShow = (value) => {
    show.value = value
  }
  const time = ref([])
  const updateTime = (value) => {
    time.value = value
  }
  const week = ref('')
  const updateWeek = (value) => {
    week.value = value
  }
  const the_time = ref('')
  const updateTheTime = (value) => {
    the_time.value = value
  }
  const when = ref('')
  const updateWhen = (value) => {
    when.value = value
  }
  const id = ref('')
  const updateId = (value) => {
    id.value = value
  }
  return { show, updateShow, time, updateTime, week, updateWeek, the_time, updateTheTime, when, updateWhen, id, updateId }
})